//
//  DouBanTabBarVc.m
//  豆瓣
//
//  Created by lanou3g on 15/12/9.
//  Copyright © 2015年 HaiTeng. All rights reserved.
//

#import "DouBanTabBarVc.h"
#import "CinemaTVC.h"
#import "UserTVC.h"
#import "ActivityVCViewController.h"
#import "MovieVc.h"


@interface DouBanTabBarVc ()

@end

@implementation DouBanTabBarVc

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
        [self setAllControllers];
    }
    return self;
}



- (void)setAllControllers
{
    //影院
    CinemaTVC *cinema = [[CinemaTVC alloc] initWithStyle:UITableViewStyleGrouped];
    UINavigationController *cinemaNC = [[UINavigationController alloc] initWithRootViewController:cinema];
    cinema.tabBarItem.image = [UIImage imageNamed:@"cinema"];
    cinema.title = @"影院";
    
    
    
    
    //用户
    UserTVC *user = [[UserTVC alloc] initWithStyle:UITableViewStyleGrouped];
    UINavigationController *userNC = [[UINavigationController alloc] initWithRootViewController:user];
    user.tabBarItem.image = [UIImage imageNamed:@"user"];
    user.title = @"我的";
    
    //活动
    ActivityVCViewController *activity = [[ActivityVCViewController alloc] init];
    UINavigationController *activityNC = [[UINavigationController alloc] initWithRootViewController:activity];
    activity.tabBarItem.image = [UIImage imageNamed:@"activity"];
    activity.title = @"活动";
 
    
    //电影
    MovieVc *movie = [[MovieVc alloc] init];
    UINavigationController *movieNC = [[UINavigationController alloc] initWithRootViewController:movie];
    movie.tabBarItem.image = [UIImage imageNamed:@"movie"];
    movie.title = @"电影";
   
    self.viewControllers = @[activityNC,movieNC,cinemaNC,userNC];
    
    
    
    //导航栏外观设置 背景图片及颜色
    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"bg_nav"] forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
    
    
    
    
    
}





@end
